Skip to content

Conversation

@akbad
Copy link

@akbad akbad commented Oct 19, 2025

Overview

Hi, I ran into problems trying to start the server after installing it using uv sync.
This PR fixes the 2 issues required to get the server to start on Python 3.12+.

The server now successfully starts using:

  • uv run python -m src.main (as in the README)
  • uv run sourcegraph-mcp also works, of course
  • running as a script via uv run python src/main.py

Fixes

  • Import path mismatch (fixed in f39dd6d)

    • Commit ebbf4bc changed imports to use relative paths (e.g. from server import ...)
    • However, based on the existing package structure, to run the server as a module the imports must be package-qualified (i.e. from sourcegraph_mcp.server import ...)
  • FastMCP issues (fixed in 5fe47fe)

    • Upgraded fastmcp dep from ==2.4.0 to >=2.11.2 (to integrate upstream fix for Python 3.12+ "default vs default_factory" bug)
    • Refactored tool registration to use @server.tool() decorators (as needed by new
      FastMCP API)
    • Migrated SSE endpoint configuration to new env variables (FASTMCP_SSE_PATH,
      FASTMCP_MESSAGE_PATH) and updated Dockerfile, .env.sample, and README accordingly

akbad added 2 commits October 19, 2025 01:31
…patibility) and adapt to new API

- Upgrade FastMCP from 2.4.0 to >=2.11.2 (fixes Pydantic field bug)
- Refactor tool registration to use `@server.tool()` decorators (required by new FastMCP version)
- Migrate SSE path config to use env variables (since prev method is now deprecated by FastMCP)

All changes are interdependent to maintain the server in a working state
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant